function sayHello {
    if ($args.Count -eq 0) {
        "No argument!"
    } else {
        # Using subexpression $() to ensure proper variable expansion (as foreach uses $_)
        # $args | ForEach { "Hello, $_!" }
        $args | ForEach { "Hello, $($_)!" }
    }
}

sayHello
sayHello "Alice" "Bob" "Charlie"

